package com.aspose.cells;

import java.util.HashMap;

class zcau extends zcdb {
   private static final com.aspose.cells.b.c.a.za a = new com.aspose.cells.b.c.a.za(new String[]{"#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"});

   void a(Cell var1, HashMap var2) throws Exception {
      int var3 = 0;
      boolean var4 = false;
      byte[] var5 = var1.w();
      int var11 = var5.length;
      Object var6 = var1.getValue();
      switch(var1.getType()) {
      case 0:
         this.d = 10;
         this.c = new byte[11 + var11];
         if ((Boolean)var6) {
            this.c[8] = 1;
         }

         var3 = 9;
         break;
      case 1:
      case 4:
         this.d = 9;
         this.c = new byte[18 + var11];
         double var7 = 0.0D;
         var7 = var1.getDoubleValue();
         System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, this.c, 8, 8);
         var3 = 16;
         break;
      case 2:
         this.d = 11;
         this.c = new byte[11 + var11];
         switch(a.a((String)var6)) {
         case 0:
            this.c[8] = 0;
            break;
         case 1:
            this.c[8] = 7;
            break;
         case 2:
            this.c[8] = 15;
            break;
         case 3:
            this.c[8] = 23;
            break;
         case 4:
            this.c[8] = 29;
            break;
         case 5:
            this.c[8] = 36;
            break;
         case 6:
            this.c[8] = 42;
         }

         var3 = 9;
         break;
      case 3:
      case 5:
         this.d = 8;
         String var9 = (String)var6;
         if (var9 == null) {
            var9 = "";
         }

         this.c = new byte[14 + var9.length() * 2 + var11];
         byte var10 = 8;
         var3 = zcch.a(this.c, var10, var9);
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getColumn()), 0, this.c, 0, 4);
      int var12 = (Integer)var2.get(var1.r());
      System.arraycopy(com.aspose.cells.b.a.zc.a(var12), 0, this.c, 4, 4);
      if (var1.d.r().n().getSettings().getReCalculateOnOpen()) {
         this.c[var3] = 2;
      }

      System.arraycopy(var5, 0, this.c, var3 + 2, var5.length);
   }
}
